<?php
	class OperacionesController extends AppController{
		
		public $helpers = array ('Html','Form');
		
		function index(){
			$this->set('operaciones', $this->Operacione->find('all'));
		}
		
		public function add() {
			if ($this->request->is('post')) {
				if ($this->Operacione->save($this->request->data)) {
					$this->redirect(array('action' => 'index'));
				}
			}
		}
		
		function edit($id = null) {
			$this->Operacione->id = $id;
			if ($this->request->is('get')) {
				$this->request->data = $this->Operacione->read();
			} else {
				if ($this->Operacione->save($this->request->data)) {
					$this->redirect(array('action' => 'index'));
				}
			}
		}
		
		function delete($id) {
			if (!$this->request->is('post')) {
				throw new MethodNotAllowedException();
			}
			if ($this->Operacione->delete($id)) {
				$this->redirect(array('action' => 'index'));
			}
		}
		

	}
?>